import require from '@/utils/request.js'
import {
  setUrl
} from '@/utils/util'



// 获取银行简称
export function getBankName(bankNum) {
  return require({
    url: `/employee/getBankName?bankNum=${bankNum}`,
    method: 'get'
  })
}

// 添加员工信息
export function insertEmployeeInfo(data) {
  return require({
    url: '/employee/insertEmployeeInfo',
    method: 'post',
    data
  })
}


// 根据手机号码获取员工填写的信息
export function getAllEmployees(data) {
  return require({
    url: `/employee/getAllEmployees/${data}`,
    method: 'get'
  })
}



// 删除家庭成员
export function deletedEmployeeFamily(data) {
  const url = setUrl('/employee/deletedEmployeeFamily', data)
  return require({
    url,
    method: 'delete'
  })
}

// 删除工作经历
export function deleteWorkHistoryInfo(data) {
  const url = setUrl('/employee/deleteWorkHistoryInfo', data)
  return require({
    url,
    method: 'get'
  })
}


// 提交
export function addSubmit(id) {
  return require({
    url: `/employee/addSubmit?id=${id}`,
    method: 'post'
  })
}

// 三要素校验
export function checkCard(data) {
  return require({
    url: '/employee/checkCard',
    method: 'post',
    data
  })
}


// 是否填写
export function insertSubmitFillInfo(data) {
  return require({
    url: '/employee/insertSubmitFillInfo',
    method: 'post',
    data
  })
}


// 二次入职
export function getCardIdEmployeeInfo(cardId) {
  return require({
    url: `/employee/getCardIdEmployeeInfo?cardId=${cardId}`,
    method: 'get'
  })
}


// 根据 手机号码查询身份证号码跟姓名
export function getCardInfo(phone) {
  return require({
    url: `/employee/getCardInfo?mobile=${phone}`,
    method: 'get'
  })
}

// 确认同步
export function addSynEmployeeInfo(data){
  return require({
    url:`/employee/addSynEmployeeInfo?new_id=${data.new_id}&old_id=${data.old_id}`,
    method:'post'
  })

}